package com.hmall.cart.controller.inner;


import com.hmall.cart.service.ICartService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

@Api(tags = "购物车内部接口")
@RestController
@RequestMapping("/inner/carts")
@RequiredArgsConstructor
@Slf4j
public class InnerCartController {
    private final ICartService cartService;


    @DeleteMapping
    public void deleteCartItemByIds(@RequestParam("userId") Long userId,
                                    @RequestParam("ids") Collection<Long> ids){
        cartService.removeByItemIds(userId,ids);
    }
}